/* -*- Java -*-

   ServerControlWindow.java  -- Holds some Information about the server's
                                current state.

   Author:    Christoph Kuhmuench
              Lehrstuhl fuer Praktische Informatik IV
              Universitaet Mannheim, Germany
              email: cjk@pi4.informatik.uni-mannheim.de

   $Id$
*/

import java.awt.*;
import java.awt.event.*;
import java.lang.*;
import java.net.*;
import java.util.*;
import java.math.*;    // BigInteger
import java.text.*;


public class ServerControlWindow extends Frame
{
  private Server server;

  // GUI elements
  private GridBagLayout      gridbag;
  private GridBagConstraints c;

  private java.awt.List   clientList;
  private Label  snd;

  public ServerControlWindow(Server _server)
  {
    // initialize AWT components
    setTitle("JRC Server Control Frame" );
    server    = _server;
    clientList= new java.awt.List(10, false);
    snd       = new Label("snd");
    snd.setBackground(Color.gray);

    Label headline    = new Label("JRC V0.7: Server Control Window");
    Font  headlinefont= new Font("Helvetica", Font.BOLD, 16);
    headline.setForeground(Color.blue);
    headline.setFont(headlinefont);
   
    // layout components
    this.setLayout( new BorderLayout() );
 
    Panel pCtrlLabels= new Panel(new FlowLayout());
    pCtrlLabels.add(snd);
    
    this.add(headline, "North");
    this.add(clientList, "Center");
    this.add(pCtrlLabels, "South");
  };
  
  public void addClient(String clientName)
  {
    clientList.add(clientName);
  };
  public void removeClient(String clientName)
  {
    clientList.remove(clientName);
  };
  
  public void sndActive()
  {
    snd.setBackground(Color.red);
  };
  
  public void sndInactive()
  {
    snd.setBackground(Color.gray);
  };  
};








